﻿using System;
using System.Windows;
using AppLimit.NetSparkle;

namespace jelly.sample.wpf.autoupdate
{
    /// <summary>
    /// MainWindow.xaml 的互動邏輯
    /// </summary>
    public partial class MainWindow : Window
    {
        private Sparkle _sparkle;

        public MainWindow()
        {
            try
            {
                InitializeComponent();

                string appcastUrl = "http://localhost/jelly.sample.wpf.autoupdate.site/versioninfo.xml";
                string referenceAssembly = "jelly.sample.wpf.autoupdate.exe";

                _sparkle = new Sparkle(appcastUrl, referenceAssembly);
                _sparkle.StartLoop(true, true);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
    }
}
